import { reqBanner, reqCategory, reqFloor } from "@/api";
//首页的小仓库
//存储数据的地方
const state = {
    //存储商品分类的数据
    category: [],
};
//唯一可以修改数据的地方
const mutations = {
    GETCATEGORY(state, category) {
        state.category = category;
    }
};
//书写异步语句|书写逻辑
const actions = {
    async getCategory({ commit, state, dispatch, getters }) {
        const result = await reqCategory();
        if (result.code == 200) {
            commit('GETCATEGORY', result.data);
        }
    },
};
//计算属性
const getters = {};

export default {
    state,
    mutations,
    actions,
    getters
}




